package com.ht.service.impl;

import com.ht.dto.ClinicalEvaluation;
import com.ht.dto.User;
import com.ht.service.ClinicalEvaluationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;

@Service
public class ClinicalEvaluationServiceImpl implements ClinicalEvaluationService {
    @Autowired
    private MongoTemplate mongoTemplate;

    @Override
    public void insert(User user, ClinicalEvaluation clinicalEvaluation) {
        clinicalEvaluation.setUserId(user.getId());
        clinicalEvaluation.setUserName(user.getUsername());
        mongoTemplate.save(clinicalEvaluation);
    }
}
